﻿using System;

namespace diantou.web.ajax.admin
{
    /// <summary>
    /// 课程分页调用
    /// </summary>
    [fastCSharp.code.cSharp.ajax(IsPool = true)]
    class coursePage : permissionHandle<coursePage>
    {
        /// <summary>
        /// 获取课程分页
        /// </summary>
        /// <param name="courseId"></param>
        /// <param name="sortId"></param>
        /// <param name="title"></param>
        [fastCSharp.code.cSharp.ajax(IsOnlyPost = false)]
        public diantou.dataModel.coursePage Get(int courseId, byte sortId, out string problemTitle)
        {
            if ((currentUser.Permission & dataModel.user.permission.TutorialEditor) != 0)
            {
                return diantou.dataAccess.tcpCall.coursePage.get(courseId, sortId, out problemTitle);
            }
            problemTitle = null;
            return null;
        }
        /// <summary>
        /// 保存课程分页
        /// </summary>
        /// <param name="value"></param>
        /// <param name="onReturn"></param>
        public void Save(diantou.dataAccess.coursePage value, Action<fastCSharp.net.returnValue<bool>> onReturn)
        {
            if ((currentUser.Permission & dataModel.user.permission.TutorialEditor) != 0) diantou.dataAccess.tcpCall.coursePage.save(value, currentUser.Id, onReturn);
            else onReturn(false);
        }
        /// <summary>
        /// 删除课程分页
        /// </summary>
        /// <param name="value"></param>
        /// <param name="onReturn"></param>
        public void Delete(diantou.dataAccess.coursePage value, Action<fastCSharp.net.returnValue<bool>> onReturn)
        {
            if ((currentUser.Permission & dataModel.user.permission.TutorialEditor) != 0) diantou.dataAccess.tcpCall.coursePage.delete(value, currentUser.Id, onReturn);
            else onReturn(false);
        }
    }
}